#ifndef TSQLRELATIONALTABLEMODEL_H
#define TSQLRELATIONALTABLEMODEL_H

#include <QSqlRelationalTableModel>
#include <QObject>
#include <QVariant>

class TSqlRelationalTableModel : public QSqlRelationalTableModel
{
    Q_OBJECT
public:
    explicit TSqlRelationalTableModel(QObject *parent = nullptr,const QSqlDatabase &db = QSqlDatabase());

    // QAbstractItemModel interface
public:
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
    void initUserData();
private:
    QHash<QModelIndex, QVariant> userData[2];
};

#endif // TSQLRELATIONALTABLEMODEL_H
